import fs from 'fs'

const list = fs.readdirSync('./routes').filter(_ => !_.includes('_'))

export default (app) => {
  list.forEach((item) => {
    const routes = require(`../routes/${item}`)
    app.use(routes.default.routes())
  })
}
